package org.mq.mymq.broker.core;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName MMapFileModelManager
 * @Description mmap模型管理者，管理多个mmap基础模型
 * @Author jiarong_ye
 * @Date 2025/6/15 15:37
 * @Version 1.0
 */
public class CommitLogMMapFileModelManager {
    /**
     * key:主题名称， value:文件的mmap对象
     */
    private static Map<String, CommitLogMMapFileModel> mMapFileModelMap = new HashMap<>();

    public void put(String topic, CommitLogMMapFileModel commitLogMMapFileModel) {
        mMapFileModelMap.put(topic, commitLogMMapFileModel);
    }

    public static Map<String, CommitLogMMapFileModel> getmMapFileModelMap() {
        return mMapFileModelMap;
    }

    public CommitLogMMapFileModel get(String topic) {

        return mMapFileModelMap.get(topic);
    }
}
